package cc.ding.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {

    public static Date stringDateFormat(String dateTime, String pattern) {
        DateFormat dateFormat = new SimpleDateFormat(pattern);

        try {
            return dateFormat.parse(dateTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}
